load("//bazel:tachyon_cc.bzl", "tachyon_cc_library", "tachyon_cc_unittest")

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "advice_expression",
    hdrs = ["advice_expression.h"],
    deps = [
        "//tachyon/zk/expressions:expression",
        "//tachyon/zk/plonk/constraint_system:query",
        "@com_google_absl//absl/memory",
    ],
)

tachyon_cc_library(
    name = "challenge_expression",
    hdrs = ["challenge_expression.h"],
    deps = [
        "//tachyon/zk/expressions:expression",
        "//tachyon/zk/plonk/constraint_system:challenge",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "compress_expression",
    hdrs = ["compress_expression.h"],
    deps = [
        ":proving_evaluator",
        "//tachyon/base:compiler_specific",
        "//tachyon/base:openmp_util",
    ],
)

tachyon_cc_library(
    name = "expression_factory",
    hdrs = ["expression_factory.h"],
    deps = [
        ":advice_expression",
        ":challenge_expression",
        ":fixed_expression",
        ":instance_expression",
        ":selector_expression",
        "//tachyon/zk/expressions:expression_factory",
    ],
)

tachyon_cc_library(
    name = "fixed_expression",
    hdrs = ["fixed_expression.h"],
    deps = [
        "//tachyon/zk/expressions:expression",
        "//tachyon/zk/plonk/constraint_system:query",
        "@com_google_absl//absl/memory",
    ],
)

tachyon_cc_library(
    name = "instance_expression",
    hdrs = ["instance_expression.h"],
    deps = [
        "//tachyon/zk/expressions:expression",
        "//tachyon/zk/plonk/constraint_system:query",
        "@com_google_absl//absl/memory",
    ],
)

tachyon_cc_library(
    name = "proving_evaluator",
    hdrs = ["proving_evaluator.h"],
    deps = [
        ":advice_expression",
        ":challenge_expression",
        ":fixed_expression",
        ":instance_expression",
        ":selector_expression",
        "//tachyon/zk/expressions:constant_expression",
        "//tachyon/zk/expressions:evaluator",
        "//tachyon/zk/expressions:negated_expression",
        "//tachyon/zk/expressions:product_expression",
        "//tachyon/zk/expressions:scaled_expression",
        "//tachyon/zk/expressions:sum_expression",
        "//tachyon/zk/plonk/base:multi_phase_ref_table",
    ],
)

tachyon_cc_library(
    name = "selector_expression",
    hdrs = ["selector_expression.h"],
    deps = [
        "//tachyon/zk/expressions:expression",
        "//tachyon/zk/plonk/constraint_system:selector",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "verifying_evaluator",
    hdrs = ["verifying_evaluator.h"],
    deps = [
        ":advice_expression",
        ":challenge_expression",
        ":fixed_expression",
        ":instance_expression",
        ":selector_expression",
        "//tachyon/zk/expressions:constant_expression",
        "//tachyon/zk/expressions:evaluator",
        "//tachyon/zk/expressions:negated_expression",
        "//tachyon/zk/expressions:product_expression",
        "//tachyon/zk/expressions:scaled_expression",
        "//tachyon/zk/expressions:sum_expression",
        "//tachyon/zk/plonk/base:multi_phase_evaluations",
    ],
)

tachyon_cc_unittest(
    name = "expression_unittests",
    srcs = [
        "advice_expression_unittest.cc",
        "challenge_expression_unittest.cc",
        "compress_expression_unittest.cc",
        "expression_unittest.cc",
        "fixed_expression_unittest.cc",
        "instance_expression_unittest.cc",
        "proving_evaluator_unittest.cc",
        "selector_expression_unittest.cc",
    ],
    deps = [
        ":compress_expression",
        ":expression_factory",
        ":proving_evaluator",
        "//tachyon/math/finite_fields/test:finite_field_test",
        "//tachyon/math/finite_fields/test:gf7",
        "//tachyon/math/polynomials/univariate:univariate_polynomial",
        "//tachyon/zk/plonk/expressions/evaluator:simple_selector_finder",
        "//tachyon/zk/plonk/expressions/evaluator/test:evaluator_test",
        "//tachyon/zk/plonk/expressions/test:compress_expression_test",
    ],
)
